package com.zzxu.actdemo;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class actStartActivity extends AppCompatActivity implements View.OnClickListener {

    private static final String TAG = "lu";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "actStartActivity onCreate");
        setContentView(R.layout.activity_act_start);
        findViewById(R.id.btn_start_act).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        //1.在Intent的构造函数中指定
//        Intent intent = new Intent(this, actFinishActivity.class);
        //2.调用意图对象的setClass方法指定
//        Intent intent=new Intent();
//        intent.setClass(this,actFinishActivity.class);
        //3.调用意图对象的ComponentName方法指定
        Intent intent=new Intent();
        ComponentName component =new ComponentName(this,actFinishActivity.class);
//        ComponentName component =new ComponentName("","");
        intent.setComponent(component);
        startActivity(intent);
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG, "actStartActivity onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG, "actStartActivity onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG, "actStartActivity onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG, "actStartActivity onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "actStartActivity onDestroy");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d(TAG, "actStartActivity onRestart");
    }
}